home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cracking 2
/
Cracking II..iso
/
Priklady
/
Priklad 16
/
PE.INC
< prev
next >
Wrap
Text File
|
2000-07-24
|
15KB
|
311 lines
IMAGE_REL_BASED_ABSOLUTE EQU 0
IMAGE_REL_BASED_HIGH EQU 1
IMAGE_REL_BASED_LOW EQU 2
IMAGE_REL_BASED_HIGHLOW EQU 3
IMAGE_REL_BASED_HIGHADJ EQU 4
IMAGE_REL_BASED_MIPS_JMPADDR EQU 5
IMAGE_RELOCATION_DATA RECORD {
RD_RelocType :4
RD_RelocOffset :12
}
IMAGE_BASE_RELOCATION STRUC
BR_VirtualAddress DD ?
BR_SizeOfBlock DD ?
; BR_TypeOffset IMAGE_RELOCATION_DATA 1 DUP (?) ; Array of zero or more relocations (type + RVAs)
IMAGE_BASE_RELOCATION ENDS
IMAGE_SIZEOF_BASE_RELOCATION EQU SIZE IMAGE_BASE_RELOCATION ; 8
IMAGE_IMPORT_BY_NAME STRUC
IBN_Hint DW ?
IBN_Name DB 1 DUP (?) ; ASCIIZ function name (variable size)
IMAGE_IMPORT_BY_NAME ENDS
IMAGE_ORDINAL_FLAG EQU 80000000h
IMAGE_THUNK_DATA STRUC
UNION
TD_AddressOfData DD IMAGE_IMPORT_BY_NAME PTR ? ; Ptr to IMAGE_IMPORT_BY_NAME structure
TD_Ordinal DD ? ; Ordinal ORed with IMAGE_ORDINAL_FLAG
TD_Function DD BYTE PTR ? ; CODE PTR ; Ptr to function (i.e. Function address after program load)
TD_ForwarderString DD BYTE PTR ? ; Ptr to a forwarded API function.
ENDS
IMAGE_THUNK_DATA ENDS
; ──┤ Import format ├────────────────────────────────────────────────────────
IMAGE_IMPORT_DESCRIPTOR STRUC
UNION
ID_Characteristics DD ? ; 0 for terminating null import descriptor
ID_OriginalFirstThunk DD IMAGE_THUNK_DATA PTR ? ; RVA to original unbound IAT
ENDS
ID_TimeDateStamp DD ? ; 0 if not bound,
; -1 if bound, and real date\time stamp
; in IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT (new BIND)
; O.W. date/time stamp of DLL bound to (Old BIND)
ID_ForwarderChain DD ? ; -1 if no forwarders
ID_Name DD BYTE PTR ? ; RVA to name of imported DLL
ID_FirstThunk DD IMAGE_THUNK_DATA PTR ? ; RVA to IAT (if bound this IAT has actual addresses)
IMAGE_IMPORT_DESCRIPTOR ENDS
IMAGE_SIZEOF_IMPORT_DESCRIPTOR EQU SIZE IMAGE_IMPORT_DESCRIPTOR
; ──┤ Export format ├────────────────────────────────────────────────────────
IMAGE_EXPORT_DIRECTORY STRUC
ED_Characteristics DD ?
ED_TimeDateStamp DD ?
ED_MajorVersion DW ?
ED_MinorVersion DW ?
ED_Name DD BYTE PTR ? ; Ptr to name of exported DLL
UNION
ED_Base DD ?
ED_BaseOrdinal DD ?
ENDS
ED_NumberOfFunctions DD ?
UNION
ED_NumberOfNames DD ?
ED_NumberOfOrdinals DD ?
ENDS
ED_AddressOfFunctions DD DWORD PTR ? ; Ptr to array of function addresses
ED_AddressOfNames DD DWORD PTR ? ; Ptr to array of (function) name addresses
UNION
ED_AddressOfNameOrdinals DD WORD PTR ? ; Ptr to array of ordinals
ED_AddressOfOrdinals DD WORD PTR ? ;
ENDS
IMAGE_EXPORT_DIRECTORY ENDS
IMAGE_SIZEOF_EXPORT_DIRECTORY EQU SIZE IMAGE_EXPORT_DIRECTORY
; ──┤ SH_Characteristics valuez ├────────────────────────────────────────────
;MAGE_SCN_TYPE_REG EQU 00000000h ; Reserved
;MAGE_SCN_TYPE_REGULAR EQU 00000000h ; Reserved
;MAGE_SCN_TYPE_DSECT EQU 00000001h ; Reserved
;MAGE_SCN_TYPE_DUMMY EQU 00000001h ; Reserved
;MAGE_SCN_TYPE_NOLOAD EQU 00000002h ; Reserved
;MAGE_SCN_TYPE_NO_LOAD EQU 00000002h ; Reserved
;MAGE_SCN_TYPE_GROUP EQU 00000004h ; Reserved. Used for 16-bit offset code
;MAGE_SCN_TYPE_GROUPED EQU 00000004h ; Reserved. Used for 16-bit offset code
IMAGE_SCN_TYPE_NO_PAD EQU 00000008h ; Reserved
;MAGE_SCN_TYPE_COPY EQU 00000010h ; Reserved
IMAGE_SCN_CNT_CODE EQU 00000020h ; Section contains code.
IMAGE_SCN_CNT_INITIALIZED_DATA EQU 00000040h ; Section contains initialized data.
IMAGE_SCN_CNT_UNINITIALIZED_DATA EQU 00000080h ; Section contains uninitialized data.
IMAGE_SCN_LNK_OTHER EQU 00000100h ; Reserved.
IMAGE_SCN_LNK_INFO EQU 00000200h ; Section contains comments or some other type of information.
;MAGE_SCN_TYPE_OVER EQU 00000400h ; Reserved. Section contains an overlay.
;MAGE_SCN_LNK_OVERLAY EQU 00000400h ; Reserved. Section contains an overlay.
IMAGE_SCN_LNK_REMOVE EQU 00000800h ; Section contents will not become part of image.
IMAGE_SCN_LNK_COMDAT EQU 00001000h ; Section contents comdat.
; EQU 00002000h ; Reserved.
;MAGE_SCN_MEM_PROTECTED EQU 00004000h ; Obsolete.
IMAGE_SCN_MEM_FARDATA EQU 00008000h
;MAGE_SCN_MEM_SYSHEAP EQU 00010000h ; Obsolete.
IMAGE_SCN_MEM_PURGEABLE EQU 00020000h
IMAGE_SCN_MEM_16BIT EQU 00020000h
IMAGE_SCN_MEM_LOCKED EQU 00040000h
IMAGE_SCN_MEM_PRELOAD EQU 00080000h
IMAGE_SCN_ALIGN_1BYTES EQU 00100000h
IMAGE_SCN_ALIGN_2BYTES EQU 00200000h
IMAGE_SCN_ALIGN_4BYTES EQU 00300000h
IMAGE_SCN_ALIGN_8BYTES EQU 00400000h
IMAGE_SCN_ALIGN_16BYTES EQU 00500000h ; Default alignment if no others are specified.
IMAGE_SCN_ALIGN_32BYTES EQU 00600000h
IMAGE_SCN_ALIGN_64BYTES EQU 00700000h
; EQU 00800000h ; Unused.
IMAGE_SCN_LNK_NRELOC_OVFL EQU 01000000h ; Section contains extended relocations.
IMAGE_SCN_MEM_DISCARDABLE EQU 02000000h ; Section can be discarded.
IMAGE_SCN_MEM_NOT_CACHED EQU 04000000h ; Section is not cachable.
IMAGE_SCN_MEM_NOT_PAGED EQU 08000000h ; Section is not pageable.
IMAGE_SCN_MEM_SHARED EQU 10000000h ; Section is shareable.
IMAGE_SCN_MEM_EXECUTE EQU 20000000h ; Section is executable.
IMAGE_SCN_MEM_READ EQU 40000000h ; Section is readable.
IMAGE_SCN_MEM_WRITE EQU 80000000h ; Section is writeable.
IMAGE_SIZEOF_SHORT_NAME EQU 8
; ──┤ Section header format ├────────────────────────────────────────────────
IMAGE_SECTION_HEADER STRUC
SH_Name DB IMAGE_SIZEOF_SHORT_NAME DUP (?)
UNION
SH_PhysicalAddress DD BYTE PTR ?
SH_VirtualSize DD ?
ENDS
SH_VirtualAddress DD BYTE PTR ?
SH_SizeOfRawData DD ?
SH_PointerToRawData DD BYTE PTR ?
SH_PointerToRelocations DD BYTE PTR ?
SH_PointerToLinenumbers DD BYTE PTR ?
SH_NumberOfRelocations DW ?
SH_NumberOfLinenumbers DW ?
SH_Characteristics DD ?
IMAGE_SECTION_HEADER ENDS
IMAGE_SIZEOF_SECTION_HEADER EQU SIZE IMAGE_SECTION_HEADER
; ──┤ OH_DataDirectory index valuez ├────────────────────────────────────────
IMAGE_DIRECTORY_ENTRY_EXPORT EQU 0 ; Export Directory
IMAGE_DIRECTORY_ENTRY_IMPORT EQU 1 ; Import Directory
IMAGE_DIRECTORY_ENTRY_RESOURCE EQU 2 ; Resource Directory
IMAGE_DIRECTORY_ENTRY_EXCEPTION EQU 3 ; Exception Directory
IMAGE_DIRECTORY_ENTRY_SECURITY EQU 4 ; Security Directory
IMAGE_DIRECTORY_ENTRY_BASERELOC EQU 5 ; Base Relocation Table
IMAGE_DIRECTORY_ENTRY_DEBUG EQU 6 ; Debug Directory
IMAGE_DIRECTORY_ENTRY_COPYRIGHT EQU 7 ; Description String
IMAGE